using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.GamerServices;

namespace Zephyris_Space_Mercs
{
    class Helpers
    {
        public static double Mag3D(Vector3 vector)
        {
            double vecSquared = Math.Pow(vector.X, 2) + Math.Pow(vector.Y, 2) + Math.Pow(vector.Z, 2);

            return Math.Sqrt(vecSquared);
        }

        public static double EucDist3D(Vector3 vector1, Vector3 vector2)
        {
            return Math.Sqrt(Math.Abs(Mag3D(vector1) - Mag3D(vector2)));
        }

        public static float DegToRad(float degrees)
        {
            return (float)(degrees * (Math.PI / 180));
        }

        public static double Epoch()
        {
            DateTime startEpoch = new DateTime(1970, 1, 1);

            return (DateTime.UtcNow - startEpoch).TotalMilliseconds;
        }

        public static void ShowError(string title, string text)
        {
            List<string> MBOPTIONS = new List<string>();
            MBOPTIONS.Add("OK");
            Guide.BeginShowMessageBox(title, text, MBOPTIONS, 0, MessageBoxIcon.Error, null, null);
        }
    }
}
